using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using BusinessLogicLayer;
using EntityObjectLayer;

namespace WinUI
{
    public partial class frmGetPupilReport : Form
    {
        public frmGetPupilReport()
        {
            InitializeComponent();
        }

        private void frmGetPupilReport_Load(object sender, EventArgs e)
        {

        }

        private void button2_Click(object sender, EventArgs e)
        {
            BLPupilReport blR=new BLPupilReport();
            BLManagePupilInfo blP=new BLManagePupilInfo();
            BEPupil bepupil=new BEPupil();
            bepupil.sPupilID = textBox1.Text;
            DataTable dt=blP.searchPupilProfile(bepupil);
            bepupil.sPupilID = dt.Rows[0]["PupilID"].ToString();
            bepupil.sFullName = dt.Rows[0]["FullName"].ToString();
            bepupil.sAddress = dt.Rows[0]["Address"].ToString();
            //bepupil.sBirthPlace = dt.Rows[0]["NativePlace"];
            bepupil.sClassID = dt.Rows[0]["classID"].ToString();
            bepupil.sEthnicGroup = dt.Rows[0]["EthnicGroup"].ToString();
            bepupil.sFatherJob = dt.Rows[0]["FatherJob"].ToString();
            bepupil.sFatherName = dt.Rows[0]["FatherName"].ToString();
            bepupil.sMotherJob = dt.Rows[0]["MotherJob"].ToString();
            bepupil.sMotherName = dt.Rows[0]["MotherName"].ToString();
            bepupil.sNativePlace = dt.Rows[0]["NativePlace"].ToString();
            bepupil.sPhone = dt.Rows[0]["Phone"].ToString();
            bepupil.bGender = Convert.ToBoolean(dt.Rows[0]["Gender"]);
            bepupil.daBirth = Convert.ToDateTime(dt.Rows[0]["Birth"].ToString());
            bepupil.daEnterDate = Convert.ToDateTime(dt.Rows[0]["EnterDate"]);
            //bepupil.daReleaseDate = Convert.ToDateTime(dt.Rows[0]["ReleaseDate"]);
            bepupil.iFatherAge = Convert.ToInt32(dt.Rows[0]["FatherBirth"]);
            bepupil.iMotherAge = Convert.ToInt32(dt.Rows[0]["MotherBirth"]);
            bepupil.sParentEmail = dt.Rows[0]["ParentEmail"].ToString();
            bepupil.sPicLink = dt.Rows[0]["Picture"].ToString();
            bepupil.sStatus = dt.Rows[0]["Status"].ToString();
            MessageBox.Show(blR.createReport(bepupil).ToString(),"");
        }
    }
}